namespace cpp AlgorithmIPC

enum ImageFormat {
    GREY = 0,
    RGB8 = 1
}

struct ImageData {
    1: i16         width;
    2: i16         height;
    3: ImageFormat format;
    4: binary      data;
}

exception HandleFailed {
    1: string whymsg;
}

enum SetItemType {
    NUMBER = 0,
    STRING = 1,
    BOOL   = 2,
    LIST   = 3
}

struct SettingMuxNumber {
    2: double max;
    3: double min;
    4: double currentValue;
}

struct SettingMuxString {
    2: string currentValue;
}

struct SettingMuxBool {
    2: bool currentValue;
}

struct SettingMuxList {
    2: i32             currentValue;
    3: map<i32,string> valueList;
}

struct SettingItemInfo {
    1: bool             isReadOnly;
    2: string           iName;
    3: SetItemType      iType;
    4: SettingMuxNumber iNumber;
    5: SettingMuxString iString;
    6: SettingMuxBool   iBool;
    7: SettingMuxList   iList;
}

struct SettingItemValue {
    1: SetItemType iType;
    2: double      iNumber;
    3: string      iString;
    4: bool        iBool;
    5: i32         iList;
}

service Algorithm {
    string HandleImage(1: ImageData data)
    map<i32,SettingItemInfo> GetSettingList();
    bool SetSettingItem(1: i32 setid, 2: SettingItemValue item);
}
